<?php
class Admin_Acl_Role_Update_View extends NICED_View 
{
	public function execute() 
	{
		$controller = $this->getController();
        $request    = $controller->getRequest();
		$exception  = $controller->getException();
        $this->set("params", $request->get("params"));
        $request->remove("params");

		$model   = $this->import('Admin.Acl.Role.Index');

        $this->set("role", $model->get("role"));
        $model->remove("role");

        //get all access
        require_once(DIR_LIBRARY."orm".DS."acl".DS."access.php");
        $this->set("accesses", AclAccess::factory()->getAll());

        $location = array(
            0 => array("title" => "权限管理", "link" => ""), 
            1 => array("title" => "角色管理", "link" => NICED_URL::buildURL("Admin.Acl.Access.Index")), 
            2 => array("title" => "编辑", "link" => ""),
        );
        $this->set("location", $location);

		if ($exception && $exception instanceof Exception)
		{
			$error_message = $exception->getMessage();
            $this->set("error_message", $error_message);
		}

		$this->render('Admin.Acl.Role.Update');
	}

}//end class
